"""
__author__ = 'heyanmin'
__time__ = '2021/8/8 6:48 下午'
"""
import requests

from lianxi.api_demos.api.base_api import BaseApi


class TokenApi(BaseApi):

    def getToken(self):
        data1 = {
            "url":"https://qyapi.weixin.qq.com/cgi-bin/gettoken",
            "method":"get",
            "params":{
                "corpid":"",
                "corpsecret":""
            }
        }
        r = requests.request(data1)
        assert r.status_code == 200
        assert r.retCode == 1
        self.token = r.json()['asstokne']

        # r = requests.post(url=url, headers=headers, json=data)
